var delegateApp = angular.module('delegateApp', ['ngRoute', 'ngBootbox', 'flow']).config(
    [ 'flowFactoryProvider', function(flowFactoryProvider) {
        flowFactoryProvider.defaults = {
            target : '/flowUpload',             //目标网址
            maxChunkRetries : 1,                //chunk上传失败后最多尝试次数
            chunkRetryInterval : 5000,          //发生非永久性错误时重试前等待的毫秒数
            simultaneousUploads : 4,            //同时上传多少个文件
            progressCallbacksInterval : 100,    //进度报告之间的间隔毫秒数
            //throttleProgressCallbacks:1,
            withCredentials : true,             //是否附带cookies信息
            permanentErrors: [500, 501],        //将404错误排除
            method : "octet",                   //以字节的形式传输(取值octet/multipart)
            forceChunkSize : true,              //强制每个chunk都要在规定Size(1MB)内
            generateUniqueIdentifier : function () {
                var date = new Date();
                return date.getYear() + '-' +
                        date.getMonth() + date.getDay() + date.getHours() +
                    date.getMinutes() + date.getSeconds() +
                    date.getMilliseconds() + "flow";
            }
        };
        flowFactoryProvider.on('catchAll', function(event) {
            console.log('catchAll', arguments);
        });
    } ]);

delegateApp.config(function ($routeProvider) {
    $routeProvider.when('/', {
        templateUrl : '../mainContent',
        controller : 'MainContentCtrl'
    }).when('/writeProposal', {
        templateUrl : '../createProposal',
        controller : 'CreateProposalCtrl'
    }).when('/updateProposal/:proposalId', {
        templateUrl : '../createProposal',
        controller : 'UpdateProposalCtrl'
    }).when('/viewMessages', {
        templateUrl : '../viewMessages',
        controller : 'ViewMessagesCtrl'
    }).when('/myProposal', {
        templateUrl : '../myProposal',
        controller : 'ProposalSearchCtrl'
    }).when('/myDraft', {
        templateUrl : '../myDraft',
        controller : 'ProposalSearchCtrl'
    }).when('/checkProposals', {
        templateUrl : '../checkProposals',
        controller : 'ProposalSearchCtrl'
    }).when('/checkProposal/:proposalId', {
        templateUrl : '../checkProposal',
        controller : 'CheckProposalCtrl'
    }).when('/viewProposal/:proposalId', {
        templateUrl : '../viewProposal',
        controller : "ViewProposalCtrl"

    }).when('/queryProposal/queryWaitMotionProposal', {
        templateUrl : '../queryProposal/queryWaitMotionProposal',
        controller : 'QueryWaitMotionProposalCtrl'
    }).when('/queryProposal/queryPuttedIntoEffectProposal', {
        templateUrl : '../queryProposal/queryWaitMotionProposal',
        controller : 'QueryPuttedIntoEffectProposalCtrl'

    }).when('/systemConfig', {
        templateUrl : '../systemConfig',
        controller : 'SystemConfigCtrl'
    }).when('/roleManage', {
        templateUrl : '../roleManage',
        controller : "RoleManageCtrl"

    }).when('/handleRegist', {
        templateUrl : '../handleRegist',
        controller : 'HandleRegistListCtrl'
    }).when('/registProposal/:proposalId', {
        templateUrl : '../registProposal',
        controller : 'RegistProposalCtrl'

    }).when('/assistProposals', {
        templateUrl : '../assistProposals',
        controller : "AssistProposalsCtrl"
    }).when('/proposalFeedback/:proposalId', {
        templateUrl : '../proposalFeedback',
        controller : "ProposalFeedbackCtrl"
    }).when('/puttedIntoEffectProposals', {
        templateUrl : '../puttedIntoEffectProposals',
        controller : "PuttedIntoEffectProposalsCtrl"
    }).when('/waitFeedbackProposals', {
        templateUrl : '../waitFeedbackProposals',
        controller : "WaitFeedbackProposalsCtrl"
    }).when('/queryProposal/proposalSearch', {
        templateUrl : '../queryProposal/proposalSearch',
        controller : "ProposalSearchCtrl"

    }).when('/noticeList', {
        templateUrl : '../otherArticle/listPage',
        controller : "NoticeListCtrl"
    }).when('/noticeCreation', {
        templateUrl : '../otherArticle/createPage',
        controller : "NoticeCreationCtrl"
    }).when('/knowledgeList', {
        templateUrl : '../otherArticle/listPage',
        controller : "KnowledgeListCtrl"
    }).when('/knowledgeCreation', {
        templateUrl : '../otherArticle/createPage',
        controller : "KnowledgeCreationCtrl"
    }).when('/articleDetail/:articleId', {
        templateUrl : '../otherArticle/detailPage',
        controller : "ArticleDetailCtrl"
    });
});